//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
// 			VisualNovelToolkit		     /_/_/_/_/_/_/_/_/_/.
// Copyright ©2013 - Sol-tribe.	/_/_/_/_/_/_/_/_/_/.
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
using UnityEngine;
using System.Collections;
using ViNoToolkit;

/// <summary>
/// Vino API Utility Class.
/// </summary>
public static class ViNoAPI{
	
	/// <summary>
	/// Do new game.
	/// </summary>
	static public void DoNewGame(){
		ScenarioCtrl.Instance.DoNewGame();
	}

	/// <summary>
	/// Do continue.
	/// </summary>
	static public void DoContinue(){
		ScenarioCtrl.Instance.DoContinue();
	}
	
	/// <summary>
	/// Go to Next message.
	/// </summary>
	static public void NextMessage(){
		if( SystemUIEvent.Instance != null ){
			SystemUIEvent.Instance.NextMessage();
		}
	}
	
	/// <summary>
	/// Forces Auto mode.
	/// </summary>
	static public void ForceAutoMode(){
		ViNo.autoMode = true;
	}

	/// <summary>
	/// Unlocks forced auto mode.
	/// </summary>
	static public void UnlockForceAutoMode(){
		ViNo.autoMode = false;
	}
	
	/// <summary>
	/// Enables the update ADV.
	/// </summary>
	/// <param name="isUpdate">If set to <c>true</c> is update.</param>
	static public void EnableUpdateADV( bool isUpdate = true ){
		if( VM.Instance != null ){
			VM.Instance.gameObject.SetActive( isUpdate );		
		}
	}
	
	/// <summary>
	/// Saves the data.
	/// </summary>
	/// <returns><c>true</c>, if data was saved, <c>false</c> otherwise.</returns>
	/// <param name="fileName">File name.</param>
	/// <param name="info">Info.</param>
	static public bool SaveData( string fileName , ViNoSaveInfo info ){
		return ViNo.SaveData( fileName , info );
	}

	/// <summary>
	/// Do quick save.
	/// </summary>
	/// <returns><c>true</c>, if quick save was done, <c>false</c> otherwise.</returns>
	static public bool DoQuickSave(){
		return ViNo.DoQuickSave();
	}
	
	/// <summary>
	/// Do the quick load.
	/// </summary>
	/// <returns><c>true</c>, if quick load was done, <c>false</c> otherwise.</returns>
	static public bool DoQuickLoad(){	
		return ViNo.DoQuickLoad();		
	}

	/// <summary>
	/// Play a scenario.
	/// </summary>
	/// <param name="scenarioResourcePath">Scenario resource path.</param>
	static public void PlayScenario( string scenarioResourcePath ){
		ScenarioCtrl.PlayScenario( Application.loadedLevelName , scenarioResourcePath );
	}
	
	/// <summary>
	/// Play a scenario from Info.
	/// </summary>
	/// <param name="info">Info.</param>
	static public void PlayScenario( ViNoSaveInfo info ){
		ScenarioCtrl.PlayScenario( info );
	}

}